<div class="row" id="workflow_prepared_start_info">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">流程处理页</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover" id="workflow_prepared_start_table">
                    <thead>
                        <tr>
                            <th>任务ID</th>
                            <th>流程名称</th>
                            <th>任务环节</th>
                            <th>创建时间</th>
                            <th>当前的办理人</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody th:each="Task:${listTask}">
                        <form class="Task">
                            <tr>
                                <td th:text="${Task.id}"></td>
                                <td th:text="${Task.deployName}"></td>
                                <td th:text="${Task.name}"></td>
                                <td th:text="${Task.createTime}"></td>
                                <td th:text="${Task.assignee}"></td>
                                <td>
                                    <input class="btn btn-primary handle_task" type="button" value="处理流程" th:attr="taskId=${Task.id},taskName=${Task.name},taskAssignee=${Task.assignee}">
                                    <input class="btn btn-primary process_image_view" type="button" value="查看流程图" th:attr="taskId=${Task.id},taskName=${Task.name},taskAssignee=${Task.assignee}">
                                </td>
                            </tr>
                        </form>
                    </tbody>
                </table>
            </div>
            <!-- /.box-body -->
        </div>
    </div>
</div>
<script type="text/javascript">
$(function() {

    // $("#workflow_prepared_start_table").on('click', '.leaveBillDelete', doleaveBillDelete);
    // $("#workflow_prepared_start_table").on('click', '.leaveBillModify', doleaveBillModify);
    // $("#workflow_prepared_start_table").on('click', '.leaveBillStart', doleaveBillStart);

    //$(".leaveBillDelete").on('click', doleaveBillDelete);

});

function doleaveBillDelete() {

    var workflowType = $(this).attr('workflowType');
    var workflowId = $(this).attr('workflowId');
    var data = {
        "workflowType": workflowType,
        "workflowId": workflowId
    }
    //console.log(data);
    $.ajax({
        url: "/workflow/workflow_leave_delete",
        type: 'POST',
        data: data,
        success: function(result) {
            if (result.state == 1) {
                $("#mainContentId").load("workflow/workflow_prepared_start");
            } else {
                alert(result.message);
            }
        }
    });
}

function doleaveBillModify() {
    alert("暂未写完功能");
}

function doleaveBillStart() {
    var workflowType = $(this).attr('workflowType');
    var workflowId = $(this).attr('workflowId');
    var data = {
        "workflowType": workflowType,
        "workflowId": workflowId
    }

    $.ajax({
        url: "/workflow/workflow_leave_start",
        type: 'POST',
        data: data,
        success: function(result) {
            if (result.state == 1) {
                $("#mainContentId").load("workflow/workflow_prepared_start");
            } else {
                alert(result.message);
            }
        }
    });

}
</script>